﻿#ifndef DATASOURCEGDALDEM_H
#define DATASOURCEGDALDEM_H
#include "datasource.h"

#include <gdal_priv.h>
#include <osg/Shape>

#include "QString"

namespace rxtiler {

    class DataSourceGDALDEM : public DataSource
    {
        public:
            DataSourceGDALDEM();
            virtual ~DataSourceGDALDEM();
            // DataSource interface
    public:
            bool open();
            bool close();
            Extent getExtent();
            bool computerLevels(TileOption *option, int *min, int* max);
            osg::HeightField *getDEM(TileKey &key, Extent &extent);
            osg::Image *getImage(TileKey &key, Extent &extent);


private:

            GDALDataset *poDataset;
            double _xResolution;
            double _yResolution;

            rxtiler::Extent _tif;



    };
}

#endif // DATASOURCEGDALDEM_H
